Removing an old, cherished, yet pointless caveat "This documentation is
[supercollider.git] / examples / demonstrations / Modal Space.scd
bloba86f5400d1b597f28f52a0effa41c01db8e2fa73
4 // modal space
5 // mouse x controls discrete pitch in dorian mode
6 var scale, buffer;
7 scale = FloatArray[0, 2, 3.2, 5, 7, 9, 10]; // dorian scale
8 buffer = Buffer.alloc(s, scale.size,1, {|b| b.setnMsg(0, scale) });
10         var mix;
11         mix = 
12         // lead tone
13         SinOsc.ar(
14                 (
15                         DegreeToKey.kr(
16                                 buffer.bufnum,
17                                 MouseX.kr(0,15),                // mouse indexes into scale
18                                 12,                                     // 12 notes per octave
19                                 1,                                      // mul = 1
20                                 72                                      // offset by 72 notes
21                         ) 
22                         + LFNoise1.kr([3,3], 0.04)      // add some low freq stereo detuning
23                 ).midicps,                                              // convert midi notes to hertz
24                 0,
25                 0.1)
26                 
27         // drone 5ths
28         + RLPF.ar(LFPulse.ar([48,55].midicps, 0.15),
29                 SinOsc.kr(0.1, 0, 10, 72).midicps, 0.1, 0.1);
30                 
31         // add some 70's euro-space-rock echo
32         CombN.ar(mix, 0.31, 0.31, 2, 1, mix)
33 }.play